﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Principal;

namespace XCommunity.Forums
{
  public sealed class ForumsUser : IPrincipal
  {


    private IIdentity _account;
    private string[] _roles;

    internal ForumsUser( IIdentity account, string[] roles )
    {
      _account = account;
      _roles = roles;
    }


    public IIdentity Identity
    {
      get { return _account; }
    }

    public bool IsInRole( string role )
    {
      return _roles.Contains( role );
    }

    public string[] Roles
    {
      get { return _roles; }
    }

  }
}
